import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import {
  OtherOutEnterWarehouseOrderVO,
  OtherOutEnterWarehouseOrderForm,
  OtherOutEnterWarehouseOrderQuery
} from '@/api/jdAndJstSceneClassification/otherOutbound/jstOtherOutEnterWarehouseOrder/types';

/**
 * 查询聚水潭-其他出入库单列表
 * @param query
 * @returns {*}
 */
export const listOtherOutEnterWarehouseOrder = (query?: OtherOutEnterWarehouseOrderQuery): AxiosPromise<OtherOutEnterWarehouseOrderVO[]> => {
  return request({
    url: '/dataCheck/jst/otherOutEnterWarehouseOrder/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询聚水潭-其他出入库单列表
 * 01、定义后端接口
 * @param query
 * @returns {*}
 */
export const listOtherOutEnterWarehouseOrderByOutWareHouseType1 = (
  query?: OtherOutEnterWarehouseOrderQuery
): AxiosPromise<OtherOutEnterWarehouseOrderVO[]> => {
  return request({
    url: '/dataCheck/jst/otherOutEnterWarehouseOrder/list-by-out-warehouse-type1',
    method: 'get',
    params: query
  });
};

/**
 * 查询聚水潭-其他出入库单详细
 * @param id
 */
export const getOtherOutEnterWarehouseOrder = (id: string | number): AxiosPromise<OtherOutEnterWarehouseOrderVO> => {
  return request({
    url: '/dataCheck/jst/otherOutEnterWarehouseOrder/' + id,
    method: 'get'
  });
};

/**
 * 新增聚水潭-其他出入库单
 * @param data
 */
export const addOtherOutEnterWarehouseOrder = (data: OtherOutEnterWarehouseOrderForm) => {
  return request({
    url: '/dataCheck/jst/otherOutEnterWarehouseOrder',
    method: 'post',
    data: data
  });
};

/**
 * 修改聚水潭-其他出入库单
 * @param data
 */
export const updateOtherOutEnterWarehouseOrder = (data: OtherOutEnterWarehouseOrderForm) => {
  return request({
    url: '/dataCheck/jst/otherOutEnterWarehouseOrder',
    method: 'put',
    data: data
  });
};

/**
 * 删除聚水潭-其他出入库单
 * @param id
 */
export const delOtherOutEnterWarehouseOrder = (id: string | number | Array<string | number>) => {
  return request({
    url: '/dataCheck/jst/otherOutEnterWarehouseOrder/' + id,
    method: 'delete'
  });
};
